<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<c:if test="${!empty errorMsg}">
    <div class="error">${errorMsg}</div>
</c:if>